n=eval(input())
i=0
j=1
hole=0
list1=[]
while i<1000:
    hole+=j
    j+=1
    list1.append(((hole-1)%n)+1)
    i+=1
judge=0
i=1
while i<n+1:
    if i not in list1:
        judge=1
        print(i)
    i+=1
if judge==0:print(0)